<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>开始使用layui</title>
    <link rel="stylesheet" href="../../../layui/css/layui.css">
</head>
<body>

<!-- 你的HTML代码 -->
<div class="layui-tab">
    <ul class="layui-tab-title">
        <li class="layui-this">标题一</li>
        <li>标题二</li>
        <li>标题三</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">内容1
            <button class="layui-btn" lay-submit lay-filter="login">登入</button>
        </div>
        <div class="layui-tab-item">内容2</div>
        <div class="layui-tab-item">内容3</div>
    </div>
</div>

<script src="../../../layui/layui.js"></script>
<script>
    //一般直接写在一个js文件中
    layui.use(['layer', 'form','upload'], function(){
        var layer = layui.layer
            ,form = layui.form
            ,upload = layui.upload; //获取upload模块;
        //监听提交按钮
        form.on('submit(test)', function(data){
            console.log(data);
        });

        //实例化一个上传控件
        upload({
            url: '上传接口url'
            ,success: function(data){
                console.log(data);
            }
        })
    });
</script>
</body>
</html>
